package net.borlis.sample.web.context;

/**
 * @author alex@borlis.net
 */
public final class WeldContainer { // singleton

    private static WeldContainer instance;
    // -=-=-=-
    private final WeldWebContext context;

    private WeldContainer(){
        context = WeldBeanManager.loadBeanInstanceFor(WeldWebContext.class);
    }

    //todo:: improve the performance!!! sprint#15
    public static synchronized WeldContainer getInstance(){
        if (instance == null) {
            instance = new WeldContainer();
        }
        return instance;
    }

    public WeldWebContext getContext() {
        return context;
    }

}
